package com.example.backblog.repository.fileupload;

import com.example.backblog.entity.fileupload.Files;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface FilesRepository extends JpaRepository<Files, Long> {
//    List<GetFileDto> findAllBy(Pageable pageable);
    boolean existsByFileNameEquals(String fileName);
    List<Files> findAllByParentIdIsNull();
    List<Files> findAllByParentIdIsNullAndUserIdEqualsOrderByDirectorDesc(Long userId);


    List<Files> findAllByParentIdEquals(Long parentId);
    List<Files> findAllByParentIdEqualsAndUserIdEqualsOrderByDirectorDesc(Long parentId,Long userId);



    boolean existsByParentIdEquals(Long parentId);
}